import instance from "../../global";

/**
 * 用户发布的总视频量
 * @param userId 用户id
 * @returns {Promise<AxiosResponse<any>>}
 * @constructor
 */
export function PlayCounts(userId){
    return instance.post("user/video/playCounts",{userId:userId});
}

/**
 * 查询用户发布的视频
 * @param userId 用户id
 * @param pageNum 分页
 * @param pageSize
 * @returns {Promise<AxiosResponse<any>>}
 * @constructor
 */
export function QueryUserId(userId,pageNum,pageSize){
    return instance.post("user/video/queryUserId",{userId:userId,pageNum:pageNum,pageSize:pageSize});
}

/**
 * 查询视频评论量
 * @param videoId 视频id
 * @returns {Promise<AxiosResponse<any>>}
 * @constructor
 */
/*export function CommentCount(videoId){
    return instance.post("user/video/commentCount",{videoId:videoId});
}*/

/**
 * 查询用户类型
 * @constructor
 */
export function  BigzoneByUserCount(userId){
    return instance.post("user/video/bigzoneByUserCount",{userId:userId});
}

/**
 * 查询用户类型视频
 * @param userId
 * @param bigzoneName
 * @param pageNum
 * @param pageSize
 * @returns {Promise<AxiosResponse<any>>}
 * @constructor
 */
export function SynthesizeQuery(userId ,bigzoneName, pageNum, pageSize){
    return instance.post("user/video/synthesizeQuery",{userId,bigzoneName,pageNum,pageSize})
}

/**
 * 查询用户点击量最多的排序视频
 * @param userId
 * @param bigzoneName
 * @param pageNum
 * @param pageSize
 * @returns {Promise<AxiosResponse<any>>}
 * @constructor
 */
export function SynthesizeQueryDesc(userId ,bigzoneName, pageNum, pageSize){
    return instance.post("user/video/synthesizeQueryDesc",{userId,bigzoneName,pageNum,pageSize})
}

/**
 * 查询用户收藏的视频接口
 * @param userId 用户id
 * @param pageNum 分页
 * @param pageSize
 * @returns {Promise<AxiosResponse<any>>}
 * @constructor
 */
export function CollectvideoUserById(userId , pageNum, pageSize){
    return instance.post("user/video/collectvideoUserById",{userId:userId,pageNum:pageNum,pageSize:pageSize})
}

/**
 *
 * @param userId
 * @returns {Promise<AxiosResponse<any>>}
 * @constructor
 */
export function VideoIsreprintSum(userId){
    return instance.get("user/video/videoIsreprintSum",{params:{userId:userId}})
}

/**
 * 查询用户被下架的视频
 * @param userId 用户id
 * @param videoTitle 用户标题
 * @param pageNum 分页
 * @param pageSize
 * @returns {Promise<AxiosResponse<any>>}
 * @constructor
 */
export function VideoSold(userId, videoTitle,pageNum, pageSize){
    return instance.get("user/video/videoSold",{params:{userId:userId,videoTitle:videoTitle,pageNum:pageNum,pageSize:pageSize}})
}

/**
 * 删除收藏视频
 * @param userId 用户id
 * @param videoId 视频id
 * @returns {Promise<AxiosResponse<any>>}
 * @constructor
 */
export function OffCollectVideo(userId,videoId){
    return instance.get("hemo/system/collect/offCollectVideo",{params:{userId:userId,videoId:videoId}})
}

/**
 * 删除视频
 * @param videoId 视频id
 * @returns {Promise<AxiosResponse<any>>}
 * @constructor
 */
export function VideoDelByVideoId(videoId){
    return instance.get("user/video/videoDelByVideoId",{params:{videoId:videoId}})
}
